<!DOCTYPE HTML>
<html>

<head>
    <title> 总库存列表</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <link href="../../../assets/css/dpl-min.css" rel="stylesheet" type="text/css"/>
    <link href="../../../assets/css/bui-min.css" rel="stylesheet" type="text/css"/>
    <link href="../../../assets/css/page-min.css" rel="stylesheet" type="text/css"/>
    <link href="../../../assets/css/jx-style.css" rel="stylesheet" type="text/css"/>
    <link href="../../../assets/css/prettify.css" rel="stylesheet" type="text/css"/>
</head>

<body>
<div class="container">
    <div class="detail-page">
        <div class="detail-page-title">
            <h4>库存列表</h4>
        </div>
        <div class="detail-section">
            <div class="detail-row">
                <div class="jx-search-container">
                    <form id="J_Form" class="jx-form form-horizontal jx-form-thin" method="post">
                        <div class="row ">
                            <div class="control-group span7">
                                <label class="control-label">供应商:</label>
                                <div class="controls">
                                    <input name="supplierName" type="text" class="control-text">
                                </div>
                            </div>
                            <div class="control-group span7">
                                <label class="control-label">商品条形码:</label>
                                <div class="controls">
                                    <input name="barCode" type="text" class="control-text">
                                </div>
                            </div>
                            <div class="control-group span7">
                                <label class="control-label">商品货号:</label>
                                <div class="controls">
                                    <input name="goodsCode" type="text" class="control-text">
                                </div>
                            </div>
                            <div class="control-group span2 pull-right">

                                <button type="submit" class="jx-btn btn-default">搜索</button>

                            </div>
                        </div>
                        <div class="row">
                            <div class="control-group span7">
                                <label class="control-label">仓库:</label>
                                <div class="controls">
                                    <input name="supplierWarehouse" type="text" class="control-text">
                                </div>
                            </div>
                            <div class="control-group span7">
                                <label class="control-label">库存:</label>
                                <div class="controls">

                                    ><input name="stockNum" type="text" class="control-text">
                                </div>
                            </div>

                            <div class="control-group span7">
                                <label class="control-label">等级:</label>
                                <div class="controls">
                                    <select name="">
                                        <option value="">所有等级</option>
                                        <option value=""></option>
                                        <option value=""></option>
                                    </select>
                                </div>
                            </div>
                        </div>
                    </form>
                </div>

                <!-- 表格 start-->
                <div id="grid"></div>
                <!-- 表格 end-->
            </div>
        </div>
    </div>
</div>
<!-- 初始隐藏 dialog内容 -->
<div id="content" class="hide">
    <form class="form-horizontal">
        <div class="row">
            <div class="control-group span8">
                <label class="control-label">
                    <s>*</s>颜色名称：</label>
                <div class="controls">
                    <input name="b" type="text" data-rules="{required:true}" class="input-normal control-text">
                </div>
            </div>
        </div>
        <div class="row">
            <div class="control-group span8">
                <label class="control-label">
                    <s>*</s>排序：</label>
                <div class="controls">
                    <input name="a" type="text" data-rules="{required:true,number:true}"
                           class="input-normal control-text">
                </div>
            </div>
        </div>
    </form>
</div>
<script type="text/javascript" src="../../../assets/js/jquery-1.8.1.min.js"></script>
<script type="text/javascript" src="../../../assets/js/bui-min.js"></script>
<script type="text/javascript" src="../../../assets/js/config-min.js"></script>
<script type="text/javascript">
    BUI.use('common/page');
</script>
<!-- script start -->
<script>
    BUI.use(['bui/grid', 'bui/data'], function (Grid, Data) {
        var Grid = Grid,
            Store = Data.Store,
            columns = [{
                title: '商品货号',
                dataIndex: 'a',
                elCls: 'center', //居中
                width: 100
            }, {
                title: '品牌 ',
                elCls: 'center',
                dataIndex: 'b',
                width: 100
            }, {
                title: '商品名称',
                elCls: 'center',
                dataIndex: 'c',
                width: 200
            }, {
                title: '商品等级',
                elCls: 'center',
                dataIndex: 'q',
                width: 100
            }, {
                title: '商品尺码',
                elCls: 'center',
                dataIndex: 'd',
                width: 100
            }, {
                title: '供货价',
                elCls: 'center',
                dataIndex: 'e',
                width: 100
            }, {
                title: '商品条形码',
                dataIndex: 'f',
                elCls: 'center',
                width: 100
            }, {
                title: '商品总库存',
                dataIndex: 'g',
                elCls: 'center',
                width: 100
            }, {
                title: '分销库存',
                dataIndex: 'r',
                elCls: 'center',
                width: 100
            }, {
                title: '供应商',
                dataIndex: 'h',
                elCls: 'center',
                width: 100
            }, {
                title: '仓库',
                dataIndex: 'i',
                elCls: 'center',
                width: 100
            }, {
                title: '库存管理方式',
                dataIndex: 'j',
                elCls: 'center',
                width: 100
            }, {
                title: '激想仓库编码',
                dataIndex: 'k',
                elCls: 'center',
                width: 100
            }, {
                title: '自定义仓库编码',
                dataIndex: 'l',
                elCls: 'center',
                width: 100
            }, {
                title: '折扣规则',
                dataIndex: 'm',
                elCls: 'center',
                width: 100
            }, {
                title: '标签',
                dataIndex: 'n',
                elCls: 'center',
                width: 100
            }, {
                title: '销售状态',
                dataIndex: 'o',
                elCls: 'center',
                width: 100
            }, {
                title: '状态操作',
                dataIndex: 'p',
                elCls: 'center',
                width: 100,
                renderer: function (value, obj) {
                    offStr = '<span class="grid-command btn-frozen">[ 冻结 ]</span>'; //页面操作不需要使用Search.createLink
                    return offStr;
                }
            }],
            data = [{
                id: '1222',
                a: '620659-404',
                b: 'adidas',
                c: '2016女子跑步鞋620659-404',
                d: '8.5',
                e: '658.00',
                f: '75169479815',
                g: '5',
                h: '激想',
                i: '上海一仓',
                j: '激想维护',
                k: '017',
                l: 'a21',
                m: '参与折扣',
                n: '普通款',
                o: '已上架',
                q: 'A',
                r:'23'
            }, {
                id: '1222',
                a: '620659-404',
                b: 'adidas',
                c: '2016女子跑步鞋620659-404',
                d: '8.5',
                e: '658.00',
                f: '75169479815',
                g: '5',
                h: '激想',
                i: '上海一仓',
                j: '激想维护',
                k: '017',
                l: 'a21',
                m: '参与折扣',
                n: '普通款',
                o: '已上架',
                q: 'A',
                r:'23'
            }];
        var store = new Store({ //初始化数据
                data: data,
                pageSize: 2 // 配置分页数目
            }),
            grid = new Grid.Grid({
                render: '#grid',
                elCls: 'small-bui-grid-table',
                columns: columns,
                tbar: { //添加、删除
                    items: [{
                        btnCls: 'button button-small',
                        text: '批量冻结',
                        listeners: {
                            'click': FrozenFunction
                        }
                    }, {
                        btnCls: 'button button-small',
                        text: '批量解冻',
                        listeners: {
                            'click': offFrozenFunction
                        }
                    }]
                },
                bbar: {
                    // pagingBar:表明包含分页栏
                    pagingBar: true
                },
                plugins: [Grid.Plugins.CheckSelection], //插件
                store: store
            });

        grid.render();
        //点击操作
        grid.on('itemclick', function (ev) {
            var sender = $(ev.domTarget),
                itemEl = $(ev.element),
                item = ev.item;

            if (sender.hasClass('btn-frozen')) { //点击冻结
                FrozenFunction(item, itemEl);

            }
            if (sender.hasClass('btn-off-frozen')) { //点击解冻
                offSaleFunction(item, itemEl);

            }
        });
        //冻结选中的记录
        function FrozenFunction(item, itemEl) {
            BUI.Message.Confirm('确认冻结？', function () {

            }, 'question');
        }

        //解冻选中的记录
        function offFrozenFunction(item, itemEl) {
            BUI.Message.Confirm('确认解冻？', function () {

            }, 'question');
        }
    });
</script>
<!-- script end -->

<body>

</html>
